<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>table模块快速使用</title>
  <#include "/header.html">
<!--   <link rel="stylesheet" href="/layui/css/layui.css" media="all"> -->
</head>
<body>
 
<table id="demo" lay-filter="test"></table>
 
<!-- <script src="/layui/layui.js"></script> -->
<script>
layui.use('table', function(){
  var table = layui.table;
  
  //第一个实例
  table.render({
    elem: '#demo'
//     ,height: 315
    ,url: baseURL + 'ccs/record/own/list'//数据接口
    ,page: true //开启分页
    ,request: {
    	  pageName: 'page' //页码的参数名称，默认：page
    	  ,limitName: 'limit' //每页数据量的参数名，默认：limit
   	}        
    ,response: {
//     	  statusName: 'status' //数据状态的字段名称，默认：code
    	  statusCode: 200 //成功的状态码，默认：0
//     	  ,msgName: 'hint' //状态信息的字段名称，默认：msg
    	  ,countName: 'totalCount' //数据总数的字段名称，默认：count
    	  ,dataName: 'page.list' //数据列表的字段名称，默认：data
    	}
    ,cols: [[ //表头
      {field: 'recordId', title: 'ID', width:80, sort: true, fixed: 'left'}
      ,{field: 'recordName', title: '用户名', width:80}
      ,{field: 'recordOpen', title: '性别', width:80, sort: true}
      ,{field: 'recordContent', title: '城市', width:80} 
      ,{field: 'recordCtime', title: '签名', width: 177}
      ,{field: 'recordCuser', title: '积分', width: 80, sort: true}
      ,{field: 'recordId', title: '评分', width: 80, sort: true}
      ,{field: 'recordLink', title: '职业', width: 80}
      ,{field: 'recordType', title: '财富', width: 135, sort: true}
    ]],
    done: function(res, curr, count){
    	 console.log(res.page.list);
    	    
    	    //得到当前页码
    	    console.log(curr); 
    	    
    	    //得到数据总量
    	    console.log(count);
    }
  });
  
});
</script>
</body>
</html></body>
</html>